package com.kgame5.xtank3d.model.block {
import kgame5.k3d.core.math.Vector3D;
import kgame5.enginex.Entity;
import kgame5.enginex.comp.IBlock;
import kgame5.enginex.comp.IRender;
import kgame5.k3d.core.obj3d.hardvo.HardVO;
import kgame5.k3d.core.obj3d.node3d.Node3D;

import com.kgame5.xtank3d.vo.BlockVO;

/**
 * @author kk
 */
public class BlockEntity extends Entity implements IRender,IBlock{
	
	private var vo:BlockVO;
	
	public function BlockEntity(p_vo:BlockVO){
		super(p_vo);
		vo=p_vo;
		comp=new BlockViewComp(vo);
		
		//设置好初始位置
		comp.move(vo.hardVO.v3d_p.x, vo.hardVO.v3d_p.y, vo.hardVO.v3d_p.z);
		comp.getNode3D().rotY = vo.hardVO.v3d_r.y;
	}

	//---------------IBlock-------------
	public function getBlockHardVO():HardVO{
		return vo.hardVO;
	}

	//---------------logic--------------
	//---------------view-----------------
	//简单情况不需要使用viewComp
	private var comp:BlockViewComp;
	public function updateView():void{
		//空
	}
	public function getNode3D():Node3D{
		return comp.getNode3D();
	}
	public function getShadow3D():Node3D{
		return comp.getShadow3D();
	}
}
}

